package se.webbzon.oschi01.worldobject.appearance;

import java.awt.Color;

import javax.media.j3d.BoundingSphere;
import javax.media.j3d.PointLight;
import javax.vecmath.Color3f;
import javax.vecmath.Point3d;
import javax.vecmath.Point3f;

public class PointLightAppearance3D extends LightAppearance3D {
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new point light appearance. **/
	public PointLightAppearance3D(Color color) {
		super(new PointLight(true,new Color3f(color),	new Point3f(0.0f,0.0f,0.0f),
														new Point3f(0.0f,0.0f,0.0f)));
		setInfluencingBounds(new BoundingSphere(new Point3d(0.0,0.0,0.0), 1000.0));
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Copies the attenuation (constant, linear, quadratic) to the
	 * given Point3f. **/
	public void getAttenuation(Point3f attenuation) {
		((PointLight) getLight()).getAttenuation(attenuation);
	}
	
	/** Sets the attenuation (constant, linear, quadratic) of this
	 * WorldObjectPointLightAppearance instance. */
	public void setAttenuation(Point3f attenuation) {
		((PointLight) getLight()).setAttenuation(attenuation);
	}

}
